home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_squid.idb / usr / freeware / squid / bin / RunAccel.z / RunAccel
Encoding:
Text File  |  1999-07-16  |  735 b   |  37 lines

  1. #!/bin/sh
  2. #
  3. #  $Id: RunAccel.in,v 1.5 1999/01/29 18:19:45 wessels Exp $
  4.  
  5. # enable HTTP requests on port 80
  6. port="-a 80"
  7.  
  8. prefix=/usr/freeware/squid
  9. exec_prefix=${prefix}
  10. logdir=${prefix}
  11. PATH=${exec_prefix}/bin:/bin:/usr/bin
  12. export PATH
  13.  
  14. if test $# = 1 ; then
  15.     conf="-f $1"
  16.     shift
  17. fi
  18.  
  19. failcount=0
  20. while : ; do
  21.     echo "Running: squid $port -s $conf >> $logdir/squid.out 2>&1"
  22.     start=`date '+%d%H%M%S'`
  23.     squid -N $port -s $conf >> $logdir/squid.out 2>&1
  24.     stop=`date '+%d%H%M%S'`
  25.     t=`expr $stop - $start`
  26.     if test 0 -le $t -a $t -lt 5 ; then
  27.         failcount=`expr $failcount + 1`
  28.     else
  29.         failcount=0
  30.     fi
  31.     if test $failcount -gt 5 ; then
  32.               echo "RunCache: EXITING DUE TO REPEATED, FREQUENT FAILURES" >&2
  33.         exit 1
  34.     fi
  35.     sleep 10
  36. done
  37.